#include "../../include/gui_qt_demo/dataInclude/structData.h"
#include "../../include/gui_qt_demo/dataInclude/singleData.h"

TabRosConnData::TabRosConnData(TabBase* tab):
tab_(tab)
{
  initWork();
}
TabRosConnData::TabRosConnData()
{
  initWork();
}

TabRosConnData::~TabRosConnData()
{

}
void TabRosConnData::initWork(){
  isRememberData_= true;
  isAutoConnNext_ = true;
  isUseLocalNode_ = true;
  DataPtr->addTabData(TabSort::ROSCONN,this);
  QObject::connect(this, SIGNAL(rosConnectSignals(bool)), tab_, SLOT(rosConnSolt(bool)));
}

void TabRosConnData::setRosMasterUrl(std::string url){
  ros_master_url_ = url;
}
std::string TabRosConnData::getRosMasterUrl(){
  return ros_master_url_;
}
void TabRosConnData::setRosIP(std::string rosip){
  ros_ip_ = rosip;
}
std::string TabRosConnData::getRosIP(){
  return ros_ip_;
}
void TabRosConnData::setRemem(bool isRemember){
  isRememberData_ = isRemember;
}
bool TabRosConnData::getRemem(){
  return isRememberData_;
}
void TabRosConnData::setAutoConn(bool autoconn){
  isAutoConnNext_ = autoconn;
}
bool TabRosConnData::getAutoConn(){
  return isAutoConnNext_;
}
void TabRosConnData::setUseLocalNode(bool isuse){
  isUseLocalNode_ = isuse;
}
bool TabRosConnData::getUseLocalNode(){
  return isUseLocalNode_;
}

void TabRosConnData::connected(){
  Q_EMIT rosConnectSignals(true);
}
void TabRosConnData::notConnected(){
  Q_EMIT rosConnectSignals(false);
}


